/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.emex.app.stuff.utils;

import com.emex.app.stuff.security.SecurityManager;
import javax.xml.namespace.QName;

/**
 * Web service helper for desktop-side
 *
 * @author Sergey Karavaev
 */
public class WebServiceHelper {

    private static final WebServiceHelper instance = new WebServiceHelper();

    /**
     * Get default WebServiceHelper.
     *
     * @return the single WebServiceHelper object
     */
    public static WebServiceHelper getDefault() {
        return instance;
    }

    public String getWebServiceURL(String moduleName, String webServiceName) {
        return SecurityManager.getDefault().getConnectionURL()
                + "/" + moduleName + "/" + webServiceName + "WS" + "/" + webServiceName + "WS" + "?wsdl";
    }

    public QName getWebServiceQName(String webServiceName) {
        return new QName("http://emex.com/" + webServiceName, webServiceName + "WS");
    }
}
